<me:UIWBDAT x:Class="WPFExcelReport.TWBDAT"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:WF="clr-namespace:WPFExcelReport;assembly=TWAFARBEN"  
                      xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                     x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWBDAT.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/> 
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>  
    </me:UIWBDAT.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0"> 
            <WrapPanel>
                <WrapPanel Visibility="{Binding IsCanNew,ElementName=TV,Converter={StaticResource bv}}" > 
                <Grid Margin="10,0,0,0"  VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                        <Button   Click="NewCommand" Height="24" Margin="5,0,0,0" Width="20" > 
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=新入库}}"></TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                        <Button  Click="ManageCommand" Height="24" Margin="5,0,0,0" Width="20" >
                            <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Extend.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=库存查询}}"></TextBlock>
                </Grid>
                </WrapPanel>
                <Grid Margin="10,0,0,0" Visibility="{Binding IsCanDelete,ElementName=TV,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button Click="DeleteCommand" Height="24" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/remove.png" />
                        </Button.Background>
                    </Button>
                </Grid>
              
                <Grid Margin="10,0,0,0" Visibility="{Binding IsEdit,Converter={StaticResource bv}}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Button   Click="SaveCommand" Height="24" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/save.png" />
                        </Button.Background>
                    </Button>
                    <TextBlock   Grid.Column="1" Text="{Binding Source={Localization:Translate Word=删除整个批次}}"></TextBlock>
                </Grid> 
               
                <WrapPanel Visibility="{Binding IsNew,Converter={StaticResource bv}}" >
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>

                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=库位:}}"></TextBlock>
                        <CheckBox  Grid.Column="1" Name="cWH"></CheckBox>
                        <WrapPanel  Grid.Column="2" >
                            <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LO, ElementName=TV}" Width="40"/>
                            <ex:TXT72  MaxLength="2" CharacterCasing="Upper"  Text="{Binding LB, ElementName=TV}" Width="60"/>
                            <ex:TXT72  MaxLength="8" CharacterCasing="Upper"  Text="{Binding LP, ElementName=TV}" Width="60"/>
                            <WH:TSWH  KEY="{Binding WH,ElementName=TV}"
                                      Visibility="{Binding IsChecked,ElementName=cWH,Converter={StaticResource bv}}"/>
                        </WrapPanel>
                    </Grid>
                    <SD:K8877 IsEdit="True"
                              KEYS="R;F;"
                              KEY="{Binding WAKZ,ElementName=TV}"
                        />
                    <WF:TSWS06 IsEdit="True"
                                   Name="cWS"
                                   dwWS="{Binding dwWS,ElementName=TV}"
                                   dwWF="{Binding dwWF,ElementName=TV}" />
                    <Grid Margin="10,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock   Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=实际克重g/m:}}"></TextBlock>
                        <ex:NumericBox Grid.Column="1"
                                        IsReadOnly="{Binding IsEdit, Converter={StaticResource not}}" 
                                        FontSize="18" Text="{Binding ACTRLFD,ElementName=TV}"
                                        Width="60" />
                    </Grid>
                    <Button   Click="NewCommand" Height="24" Margin="5,0,0,0" Width="20" >
                        <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button> 
                </WrapPanel>
            
            </WrapPanel>
            <WrapPanel>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=品种/色号:}}"/>
                    <TextBlock Grid.Column="1" Text="{Binding WBART}" Width="Auto"></TextBlock>
                    <TextBlock Grid.Column="2" Text="{Binding WBFARBE}" Width="Auto"></TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top"  >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding Source={Localization:Translate Word=卡号:}}"/>
                    <TextBlock Grid.Column="1" Text="{Binding WBRWKRS}" Width="24"></TextBlock>
                    <TextBlock Grid.Column="2" Text="{Binding WBRWLFD}" Width="80"></TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=匹数:}}"   FontSize="18"></TextBlock>
                    <TextBlock Grid.Column="1" Text="{Binding WBSTK,Source={StaticResource vwMaster}}" FontSize="18"  Width="30" ></TextBlock>
                </Grid>
                <Grid Margin="10,0,0,0" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" FontSize="18" Text="{Binding Source={Localization:Translate Word=长度:}}" ></TextBlock>
                    <TextBlock Grid.Column="1" Text="{Binding WBMTR,Source={StaticResource vwMaster},Converter={StaticResource d100}}" FontSize="18" Width="80" ></TextBlock>
                </Grid>
            </WrapPanel>
        </StackPanel> 
    </Grid>
</me:UIWBDAT>
